
; (() => {
    const oUsername = document.getElementById('uesername')
    const oBtn = document.getElementById('entry')
    function init() {
        bindBtn()
    }
    function bindBtn() {
        oBtn.addEventListener('click', btnHandle, false)
    }
    function btnHandle() {
        const username = oUsername.value
        if (username.length < 6) {
            alert('用户名不能小于6位')
            return;
        }
        window.localStorage.setItem('username', username)
        window.location.href = 'index.html'
    }
    init()
})()